ngl: Do nothing for transparent color nodes
authorMatthias Clasen <mclasen@redhat.com>
Thu, 15 Jul 2021 17:16:37 +0000 (13:16 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 15 Jul 2021 17:18:23 +0000 (13:18 -0400)
No need to send commands to the GPU to render transparency.

gsk/ngl/gsknglrenderjob.c

index b876e6e24848a58a875863c5005b30378c93e76d..8785766612f2fbb35581fbaa67676e12b23d84eb 100644 (file)
@@ -1373,11 +1373,16 @@ static inline void
 gsk_ngl_render_job_visit_color_node (GskNglRenderJob     *job,
                                      const GskRenderNode *node)
 {
+  const GdkRGBA *rgba;
   guint16 color[4];
   GskNglProgram *program;
   GskNglCommandBatch *batch;
 
-  rgba_to_half (gsk_color_node_get_color (node), color);
+  rgba = gsk_color_node_get_color (node);
+  if (gdk_rgba_is_clear (rgba))
+    return;
+
+  rgba_to_half (rgba, color);
 
   /* Avoid switching away from the coloring program for
    * rendering a solid color.